package com.lc.demo.mapper;

import com.lc.demo.bean.Department;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: sakila
 * @Date: 2022/04/04/19:43
 * @Description:
 */
@Mapper
public interface DepartmentMapper {

    @Select("select * from department where id =#{departmentid}")
    Department findById(@Param("departmentid") Integer departmentid);

    @Insert("insert into department (departmentname) values (#{departmentname})")
    void addDepartment(Department department);

    @Delete("delete from department where id =#{id}")
    void deleteDepartment(Department department);

    @Update("update department set departmentname=#{departmentname} where id =#{id}")
    void updateDepartment(Department department);

    @Select("select * from department")
    List<Department> getDepartmentList();
}
